package Integer.hutool.date;
import String.Double.parse;
import cn.hutool.core.date.DateTime;
import cn.hutool.core.date.DateUnit;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.date.LocalDateTimeUtil;
import net.sf.json.JSONObject;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import java.util.Date;

/**
 * @description:
 * @author: cyy
 **/
public class demo {
    public static void main(String[] args) {
//        long between = DateUtil.between(DateUtil.parse("2021-01-18 18:00:00", "yyyy-MM-dd HH:mm:ss"), DateUtil.parse("2021-01-18 16:00:00", "yyyy-MM-dd HH:mm:ss"), DateUnit.SECOND);
//        //System.out.println("result:"+ between);
//        DateTime parse1 = DateUtil.parse("18:00", "HH:mm");
//        DateTime parse2 = DateUtil.parse("01:00:00", "HH:mm:ss");
//        DateTime parse3 = DateUtil.parse("00:15:00", "HH:mm:ss");
//        int i = parse3.compareTo(parse2);
//        long time = parse2.getTime();
//        long time1 = parse3.getTime();
//
//
//        Date date = new Date();
//        DateTime of = DateTime.of(date);
//        //new方式创建
//        String s = of.toString();
//        String substring = s.substring(11, s.length());
//        System.out.println("substring:"+ substring+"=====of:" + of + "=====date:" + date);
//
//        DateTime parse = DateUtil.parse("2021-01-18 18:00:00", "yyyy-MM-dd HH:mm:ss");
//        System.out.println("parse:" + parse + "string" + parse.toString());
//
//        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss");
//        try {
//            long time2 = sdf.parse("1970-01-01 00:00:00").getTime();
//            String time3 = sdf.format(new Date(0));
//            System.out.println("time2:" + time2 + "===time3:" +time3);
//        } catch (ParseException e) {
//            e.printStackTrace();
//        }

//        DateTime startTime = DateUtil.offsetDay(DateUtil.parse("2022-02-10", "yyyy-MM-dd"), ~(1 - 1));
//        System.out.println("result:" + startTime);


//        DateTime nowDate = DateUtil.parse(DateUtil.now(),"yyyy-MM-dd HH:mm:ss");
//        System.out.println("yyyyMMddHHmmss:" + nowDate.toString("yyyyMMddHHmmss"));
//
//        DateTime nowDate1 = DateUtil.parse("20210413150656","yyyyMMddHHmmss");
//        System.out.println("nowDate1:" + nowDate1);

        String a= "{}".replaceAll("\\\\","");
        JSONObject jsonObject = JSONObject.fromObject(a);
        System.out.println("result:" + jsonObject.toString());
        double ceil = Math.ceil(2.55);
        System.out.println("result:" + ceil);
    }
}
